<?php
class TourCategory extends TourCategoryPeer
{
	function TourCategory()
	{
		parent::TourCategoryPeer();
	}
	
	
	public static function retriveByTourAndCategory($tour_id, $category_id)
	{
		$db = new Database();
		$query = "SELECT id FROM tour_category WHERE tour_id = ".$tour_id." AND category_id = ".$category_id;
		$result = $db->query($query);
		$id = $db->result;
		$id = mysql_fetch_row($id);
		if (isset($id[0])) {
			$id = $id[0];
			$tour_category = new TourCategory();
			$tour_category->select($id);
			return $tour_category;
		}
		return null;
		
	}
}
?>